home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_500 / wiconify / wiconsetter.lzh / wIconSetter / wIconSetter.doc < prev    next >
Text File  |  1991-04-19  |  27KB  |  610 lines

  1. OVERVIEW:
  2.  
  3. wIconSetter is a companion utilitiy to wIconify.  It allows you to specify
  4. the icon imagery and attributes for any window that uses the default
  5. wIconify window icon, and sny screen that uses the default screen icon.
  6. You can specify windows by the program that opens them, the screen they are
  7. on and the title of the window, so very flexible identification is possible.
  8. You can specify the icon's imagery, its name, its initial position, and its
  9. attributes, and can even indicate that a window should be iconified as soon
  10. as it is openned.
  11.  
  12.  
  13. USING WICONSETTER:
  14.  
  15. You should place the wIconSetter command in the C: directory (or somewhere
  16. in the command path), and the wIconSetter-Handler file in the L: directory.
  17.  
  18. wIconSetter reads an initialization file in order to find out what icons you
  19. want to use.  If you do not specify a file on the command line, wIconSetter
  20. will look for WICONIFY:WICONSETTER.INIT, and if that can not be found, it
  21. will look for S:WICONSETTER.INIT.
  22.  
  23. To start wIconSetter, use the command
  24.  
  25.     1> WICONSETTER [initfile]
  26.  
  27. where [initfile] is the name of the initialization file to use.  wIconify
  28. must be running in order for wIconSetter to work (it will exit with an error
  29. message if it is not), and the initialization file must include at least one
  30. icon specification.
  31.  
  32. If you want wIconSetter to run automatically when you boot your Amiga,
  33. you must add the WICONSETTER command to your startup-sequence (found in
  34. the S: directory), usually right after the WICONIFY command.
  35.  
  36. To stop wIconSetter, simply issue a WICONSETTER command while wIconSetter
  37. is running.  This will remove the handler from memory, subject to some
  38. limitations.   See TECHNICAL DETAILS below for more information about
  39. ending wIconSetter.
  40.  
  41.  
  42. WHAT WICONSETTER DOES:
  43.  
  44. wIconSetter traps the OpenWindow() Intution routine and whenever a new
  45. window is openned, wIconify looks to see if you have specified an icon for
  46. the new window.  If so, wIconSetter adds the icon to the window so that when
  47. you use the left-right mouse click (or whatever iconify key sequence you
  48. have specified) the window will be iconified using the given icon.
  49.  
  50. wIconSetter determines whether you have specified an icon by looking at the
  51. name of the program that is openning the window, the title of the screen on
  52. which it is being openned, and the title of the window itself, and comparing
  53. these to the values you have given in the initialization file (see below).
  54. If no match is found, the window is openned unaffected by wIconSetter.
  55.  
  56. The Intuition SetWindowTitles() routine also is trapped by wIconSetter. 
  57. When a window's title is changed, wIconSetter checks to see if you have
  58. specified an icon for the window with the new title.  This is useful for
  59. windows that have their titles added after they are openned, such as the
  60. Clock and Calculator program provided with WB 1.3.
  61.  
  62. Finally, wIconSetter also traps the OpenScreen() Intuition function, and
  63. when a new screen is openned, it checks to see if you have specified a screen
  64. icon for that screen.  Screens are identified by name and by the name of the
  65. program that opens them.
  66.  
  67.  
  68. THE WICONSETTER INITIALIZATION FILE:
  69.  
  70. To specify that a certain window should have an icon, you must tell
  71. wIconSetter what program will open the window, what screen it will be on,
  72. and what the title of the window will be.  The special keyword '[ANY]' can
  73. be used as a wildcard that will match any title.  For example, if you
  74. specify the program 'emacs', screen '[ANY]', window '[ANY]', then the icon
  75. information you give for this specification will be used for any window
  76. openned by the program EMACS on any screen.  The special keyword '[NULL]'
  77. represents a window or screen that has no title at all.  To specify a blank
  78. title, use ''.
  79.  
  80. To specify the desired program, screen and window, use the commands
  81. PROGRAM:, SCREEN: and WINDOW: (the colons are necessary), as in:
  82.  
  83.     PROGRAM:    'EMACS'
  84.       SCREEN:   '[ANY]'
  85.         WINDOW: '[ANY]'
  86.  
  87. The quote characters are optional, and if they are left out, the remainder
  88. of the line will be used as the title.  If you need to specify a quote
  89. within a quote, use two quotes in a row, as in:
  90.  
  91.     WINDOW:  'Joe''s Window'
  92.  
  93. If you are specifying more than one window title for the same screen, you do
  94. not need to repeat the PROGRAM and SCREEN commands.  Similarly, if there is
  95. more that one screen title for the same program, the PROGRAM command need
  96. only be issued once.  For example:
  97.  
  98.  
  99.     Program:    Workbench
  100.       Screen:     Workbench
  101.         Window:    Workbench    ; the main Workbench window
  102.            /* icon specification goes here, see below */
  103.  
  104.         Window:   'RAM DISK'    ; the Ram disk main window
  105.            /* icon specification here */
  106.  
  107.         Window:   '[ANY]'       ; any other WB window
  108.            /* icon spec */
  109.  
  110.       Screen:     [ANY]
  111.         Window:     '[ANY]'     ; any window on any other screen
  112.            /* icon spec */
  113.  
  114.  
  115. Note that you must include leading spaces if they appear in the title of a
  116. screen or window you are trying to specify; e.g., ' Title with a space'.
  117.  
  118. wIconSetter does not distinguish between upper an lower case when it
  119. compares names, so 'wIconify' matches 'WICONIFY', 'WIcoNify' and 'wiconify'.
  120.  
  121. Note that you can also specify PROGRAM: [ANY] if you want to spcify icons by
  122. screen or window title only.
  123.  
  124. If more than one window title should get the same icon, you can use more
  125. than one WINDOW command in a row, as for example
  126.  
  127.    Program:    'NEWCON'
  128.       Window:  'AmigaShell'
  129.       Window:  'AmigaDOS'
  130.          /* icon specification here */
  131.  
  132. If you omit any of the SCREEN, WINDOW or PROGRAM commands, wIconSetter will
  133. assume a value of '[ANY]'.  For example, in
  134.  
  135.    Program:     'Emacs'
  136.       Window:   'MicroEmacs'
  137.  
  138. a screen of '[ANY]' is assumed.
  139.  
  140. For window and screen titles, you do not need to specify the complete title,
  141. just the first word or so; wIconSetter does a prefix match against the
  142. actual window or screen title of the window being openned.  That is, if you
  143. specify a screen of 'wIconify' this will match 'wIconify v3.7',
  144. 'wIconify Screen', or any other title starting with the word 'wIconify'.
  145. This is only true for screen and window titles, however; program names must
  146. be given in their entirety.
  147.  
  148. Use '[NULL]' to specify a window or screen that has no title at all, and use
  149. empty-quotes, '', for a window or screen whose title is blank (i.e., it's
  150. title pointer is non-NULL, but points to a string that contains a 0-byte as
  151. its first character).  These two titles are treated specially, in that they
  152. do not prefix-match any other titles (otherwise, for example, '' would match
  153. against ANY window, and there would be no way to specify a blank title).
  154.  
  155. To specify a screen icon, simply place the icon specification directly after
  156. the SCREEN command, and before any WINDOW commands, as in the following:
  157.  
  158.     Program: 'Emacs'
  159.       Screen: '[ANY]'
  160.           /* screen icon goes here */
  161.         Window: '[ANY]'
  162.           /* window icon goes here */
  163.  
  164.  
  165. Once you have given PROGRAM, SCREEN, and WINDOW commands that specify the
  166. window or screen you want to add an icon to, you can use IMAGE, SELECT, MASK,
  167. NAME, POSITION, and FLAGS commands to specify the icon's image, select image,
  168. image mask (for dragging), name, initial position, and flags.  You can
  169. include as many or as few of these commands as you like.  For example:
  170.  
  171.     Program:  'Clock'  Name: 'Clock'  Position: (600,160)
  172.  
  173. specifies that any window openned on any screen by the program called
  174. 'Clock' should have an icon titled 'Clock' that will appear at 600 pixels
  175. from the left of the screen and 160 down from the top of the screen when it
  176. is first iconified.
  177.  
  178.  
  179. INITIALIZATION FILE COMMANDS:
  180.  
  181.     NAME: 'name'
  182.  
  183. NAME determines what title will appear under the icon when the window or
  184. screen is iconified.  Usually this is the title of the window or screen itself,
  185. but some titles are quite long, and it is convenient to use wIconSetter to
  186. give them some shorter name.  You can also add icon titles to windows and
  187. screens that have no titles.
  188.  
  189.  
  190.     POSITION: (x,y)
  191.  
  192. POSITION sets the initial position of the icon when it is first iconified.
  193. If the user moves the icon, however, the inital position is lost (the icon
  194. can be made un-movable by using the FLAGS command described below).  The
  195. parenthesies are required, as is the comma.  The x value is the number of
  196. pixels from the left of the screen and the y value is the number of pixels
  197. from the top of the screen.
  198.  
  199.  
  200.     FLAGS: flag | flag ...
  201.  
  202. The flags may be any of the following:
  203.  
  204.     NOSAVEPOS       icon will not remember its old position when openned
  205.     NOCLOSE         the CLOSE menu item will not be available for this icon
  206.     NOMOVE          icon can not be dragged from its initial position
  207.     NOORGANIZE      icon will not be affected by the ORGANIZE or CLEANUP menus
  208.     LOCKED          icon is not allowed to move under any circumstances
  209.     NOMULTISELECT   multiple icons can not be selected together with this one
  210.     CHANGEREFRESH   a SMART_REFRESH window will be converted to
  211.                     SIMPLE_REFRESH window automatically when iconified
  212.                     (saves space, but may loose data within the window)
  213.     NOICONIFY       window will not be able to be iconified
  214.     AUTOICONIFY     window will be iconified as soon as it opens
  215.  
  216. For example:
  217.  
  218.     Program: [ANY]
  219.       Window:  'AmigaShell'   FLAGS: CHANGEREFRESH | AUTOICONIFY
  220.  
  221. specifies that any window called 'AmigaShell' on any screen will change from
  222. a smart to a simple refresh window when iconified, and when a new one is
  223. openned, it will be iconified automatically.
  224.  
  225.  
  226.     IMAGE:
  227.     SELECT:
  228.     MASK:
  229.  
  230. All three of these have the same format; it is the same format used in 
  231. the wIconify.init file to specify DEFAULT_IMAGE, DEFAULT_SELECT, and 
  232. DEFAULT_MASK.  The lines that follow the IMAGE, SELECT or MASK command
  233. represent the pixel pen colors for the image or mask specified.  Each line
  234. gives the values for one row of the image, and each character (past the
  235. initial blanks) represents one pixel of the image.  The character is the
  236. pen color for that pixel; for example a '2' is pen color 2, and a '0' is the
  237. background pen (color 0).
  238.  
  239. For a two bitplane screen, the colors are from 0 to 3; for 3 bitplanes they
  240. are from 0 to 7;  For 4 bitplanes, they are 0 to 9 and a to f (these must
  241. be lower case letters); for 5 bitplanes, they are 0-9 and a-f for the first
  242. sixteen pen colors, and then SHIFT 0-9 and SHIFT A-F for pens from 16 to 31.
  243. I.e., ')' is pen 16, '!' is pen 17, '@' is pen 18, '#' is pen 19, up through
  244. '*' as pen 24 and '(' as pen 25.  Then 'A' is pen 26, up through 'F' as pen 31.
  245. This allows you to specify a five bitplane image if you want.
  246.  
  247. For a MASK, however, the only valid pen colors are 0 and 1.  A '1' indicates
  248. that the bit is part of the mask (the image will show through it) and a '0'
  249. indicates that the background will show through.
  250.  
  251. The standard icon size is 41 by 18, though you can specify larger or smaller
  252. icons if you want.  The size of the SELECT image should match that of the
  253. IMAGE, and the MASK should match the SELECT image, if given, or the IMAGE if
  254. there is no SELECT image.
  255.  
  256.  
  257. As an example, the definition of the default icon is:
  258.  
  259.    IMAGE:
  260.  
  261.       11111110111111111111111111111111111111111
  262.       11000110100000000000000000000011111100011
  263.       11000110111111111111111111111111222100011
  264.       11111110100000000000000000000011222111111
  265.       11111110111111111111111111111111111111111
  266.       10000000000000000000000000000000000000001
  267.       10000000000000000000000000000000000000001
  268.       10000000000000000000000000000000000000001
  269.       10000000000000000000000000000000000000001
  270.       10000000000000000000000000000000000000001
  271.       10000000000000000000000000000000000000001
  272.       10000000000000000000000000000000000000001
  273.       10000000000000000000000000000000000000001
  274.       10000000000000000000000000000000000000001
  275.       10000000000000000000000000000000000011111
  276.       10000000000000000000000000000000000012211
  277.       10000000000000000000000000000000000011001
  278.       11111111111111111111111111111111111111111
  279.  
  280.  
  281.  
  282. You may want to have more than one window use the same icon, and it would be
  283. tedious to have to include the actial bitmap for the image after each WINDOW
  284. command (it would also take up precious CHIP memory, as each image would be
  285. stored separately).  For this reason, wIconSetter allows you to define
  286. common icon images and attributes so that they can be shared by more than one
  287. window.  To do this you use the DEFINE command.
  288.  
  289.     DEFINE: 'icon-name'
  290.  
  291. where 'icon-name' is the name of the icon you are defining.  This name will
  292. be used later when you want to associate this icon with a specific window.
  293. Following a DEFINE command, you give the IMAGE, SELECT, MASK, NAME,
  294. POSITION, and FLAG commands that you want this icon to have.  For example,
  295.  
  296.     Define:  'Small Icon'
  297.       Name:     'Tiny'
  298.       Image:
  299.  
  300.          11111111111111111111
  301.          11111111111111111111
  302.          11000000011222222211
  303.          11000000011222222211
  304.          11000000011222222211
  305.          11000000011222222211
  306.          11111111111111111111
  307.          11222222211000000011
  308.          11222222211000000011
  309.          11222222211000000011
  310.          11111111111111111111
  311.          11111111111111111111
  312.  
  313. defines a small, checker-board shaped icon with the title 'Tiny'. 
  314. Throughout the rest of the initialization file, it will be referred to as
  315. 'Small Icon', as in the example below.
  316.  
  317. To use an icon that has been defined, use the ICON command in place of the
  318. usual icon commands:
  319.  
  320.     Program:    'Example'
  321.       Window:   '[ANY]'
  322.         Icon:   'Small Icon'
  323.         Flags:   AUTOICONIFY
  324.  
  325. You can include additional icon commands after the ICON command, if you wish,
  326. as, for example, the FLAGS command above.  They can even over-ride the
  327. commands given in the DEFINE command.  For instance, we could have
  328. included a NAME command that would replace the name 'Tiny' given in the
  329. definition.
  330.  
  331. You can even DEFINE icons in terms of other icons.  For example, if two
  332. icons have the same image but different select images, you could do the
  333. following:
  334.  
  335.     DEFINE:     Icon1
  336.       IMAGE:
  337.         /* image for both icons */
  338.       SELECT:
  339.         /* select image of icon 1*/
  340.  
  341.     DEFINE:     Icon2
  342.       ICON:       Icon1     ; use the images of icon 1
  343.       SELECT:               ; but replace the select image
  344.         /* select image of icon 2 */
  345.  
  346. In this case, only one copy of the IMAGE is stored in memory, and both
  347. definitions share it.
  348.  
  349.  
  350. It is sometimes convenient to store the definitions of the images in
  351. separate files, so that the initialization file is not so large and so that
  352. it is easier to read and modify.  To do this, create a file that includes
  353. the IMAGE, SELECT, MASK, NAME, POSITION, and FLAG commands that belong to a
  354. given icon, and use the command
  355.  
  356.     ICON: FROM 'filename'
  357.  
  358. when you want to assiciate that icon to a WINDOW, SCREEN or a DEFINE command.
  359. For example:
  360.  
  361.     DEFINE:  'External Icon'
  362.       ICON:  FROM 'Icons:Fancy.Icon'
  363.  
  364. This command uses the external file FANCY.ICON in the directory associated
  365. to the ASSIGNED name ICONS: as the definition of 'External Icon'.  Later, we
  366. can use ICON: 'External Icon' as many times as we want to associate this
  367. icon with different windows.
  368.  
  369. Note that the DEFINE command does not go in the external file, nor do
  370. PROGRAM, SCREEN, WINDOW, or ICON commands.
  371.  
  372. As with DEFINED icons, you can override the values specified in the icon
  373. file by supplying additional commands after the ICON command:
  374.  
  375.     Program: 'Clock'
  376.       ICON:  FROM 'Icons:FancyClock.Icon'
  377.       FLAGS: AUTOICONIFY
  378.  
  379.  
  380. Comments can be included in the initialization file in two different ways. 
  381. The first is to use the semi-colon (;) which indicates that the remainder of
  382. the line is a comment (this works is the same way that the semi-colon works
  383. for the CLI).  All characters on the rest of the line are ignored, and
  384. processing begins at the beginning of the next line.
  385.  
  386. The second way is to use a slash (/) followed by an asterisk (*) to indicate
  387. the beginning of the comment and an asterisk followed by a slash to mark the
  388. end of the comment (this is the C language comment convention).  For example, 
  389.  
  390.     /* This is a comment */
  391.  
  392. This has the advantage of being able to "comment-out" just a portion of a
  393. line, instead on all of the line.  It can also be used to comment-out large
  394. sections of the initialization file at once.  Any characters within these
  395. comment delimiters will be ignored, including line-breaks, and the 
  396. semi-colon comment character.  Comments of this type can be nested, as
  397. indicated below:
  398.  
  399.     /* This is a /* comment inside */ another comment */
  400.  
  401. Be sure you have the proper number of closing delimiters or your whole
  402. initialization file may be ignored!  
  403.  
  404.  
  405. TECHNICAL DETAILS:
  406.  
  407. How wIconSetter Finds a Program's Name:
  408.  
  409. When a window or screen is openned, wIconSetter determines the program name by
  410. looking at the task that openned it.  The name is found in one of two ways:
  411.  
  412.     If the task is a PROCESS, then wIconSetter checks to see if the
  413.     process is a CLI process.  If so, it looks in the CLI structure
  414.     for the file name of the command that is running, and strips any disk
  415.     or directory paths from the name.  The resulting name is considered
  416.     the program name.  For example, if the command was 'df0:c/IconEd', then
  417.     the program name would be 'IconEd'.
  418.  
  419.     If the task is a process that is not a CLI (e.g., it was started from 
  420.     the Workbench), or if the task is not a process, then wIconSetter looks
  421.     for the task name in the task's node structure.  This name is treated
  422.     as a file name (in the case of a WB process, it is the name of the file
  423.     that is being executed) and any disk and directories are removed, and the
  424.     result is considered to be the program name.  For example, if you click
  425.     on a document whose default tool is 'C:More', then the process name will
  426.     be 'C:More', and the program name found by wIconSetter will be 'More'.
  427.  
  428. You can use the program wIdentify to find out what wIconSetter thinks the
  429. program names are, if you are having trouble determining the names.
  430.  
  431.  
  432. NEWCON:, CON: and RAW: windows:
  433.  
  434. Since wIconSetter uses the task that opens a window to determine the program
  435. name of the openning task, you have to be somewhat careful if you want to
  436. specify icons for CON: or RAW: windows.  When a CON: window is openned, for
  437. example, a new process is set up (the console task) which manages the IO in
  438. the newly created window.  It is this task, in fact, that opens the window,
  439. not the task that requested the CON: window.  The console task always has
  440. the name 'CON' ('RAW' for a RAW: window and 'NEWCON' for a NEWCON: window),
  441. regardless of the name of the program that requests the console window.
  442.  
  443. For example, if you type DIR > CON:0/0/640/100/Directory in a CLI window,
  444. a new CON: window will be openned and the directory output will appear there.
  445. wIconSetter will see this window as being openned by the program 'CON', not
  446. the program 'DIR'.  Similarly, NEWSHELL NEWCON:0/10/640/100/MyShell will
  447. open a new shell in a NEWCON: window, and wIconSetter will identify the
  448. program that opens this window as 'NEWCON' not as 'NEWSHELL'.  This is
  449. unfortunate, but unavoidable.  You will have to rely on the screen and
  450. window titles to distinguish among such windows.
  451.  
  452.  
  453. Windows and screens that are Open when wIcon Setter Begins:
  454.  
  455. Since wIconSetter adds icons only when windows and screens are initially
  456. openned, any windows or screens that are already open when wIconSetter is
  457. first started (normally) would not be given icons by wIconSetter.  It is
  458. desirable to have wIconSetter add icons to these windows and screens as well
  459. (if they match a window or screen title given in the initialization file).
  460.  
  461. For this reason, when you start wIconSetter, it will look through the
  462. list of open windows to see if any should get icons.  Normally, however,
  463. when wIconify checks a window to see if it should get an icon, it has a
  464. pointer to the process that is creating the window.  This is not the case
  465. for windows that are pre-existing.  wIconSetter does its best to find the
  466. program name of the exiting windows, but in some cases (namely CON: and
  467. RAW: windows), this is not possible, so wIconSetter may not be able to add
  468. icons to all the existing windows correctly.  When wIconSetter can not
  469. determine the existing program name, it uses the name '[ANY]'.
  470.  
  471. There are two approaches to solving this problem:  first, be sure to start
  472. wIconSetter early in your startup sequence so that it will be running when
  473. other windows are openned.  Second, use PROGRAM: [ANY] in the initialization
  474. file to include titles of NEWCON:, CON: and RAW: windows that should have
  475. icons.
  476.  
  477. wIconSetter does NOT add icons to existing screens at startup, since there
  478. is no way to determine the owner of an existing screen.
  479.  
  480.  
  481. Windows Openned by Intuition:
  482.  
  483. Since wIconSetter traps the OpenWindow() function in the Intuition library
  484. jump table, only windows that are created through this mechanism are
  485. modified by wIconSetter.  Intuition itself, however, does not call its own
  486. jump table, so windows openned by Intuition (e.g., "System Request" windows, 
  487. and windows created by AutoRequest() or BuildSysRequest()) do not pass
  488. through wIconSetter's trap, hence can never be modified by wIconSetter.
  489. It is pointless to specify such windows in the initialization file, since
  490. there is no way wIconSetter can add icons to them.
  491.  
  492.  
  493. Windows and Screen openned by wIconify itself:
  494.  
  495. wIconSetter uses inter-process message passing to add icons to windows and
  496. screens, and and since it does so from within the trapped OpenWindow() and
  497. OpenScreen() routines, it is operating within the environment of the process
  498. that is openning the window or screen.  This communication is done
  499. synchronously (i.e, wIconSetter calls Wait() until the reply is returned),
  500. so wIconSetter can not be used to add icons to screens (or windows) created
  501. by wIconify itself, since this would cause a deadlock situation (wIconSetter
  502. would be waiting for wIconify to reply, but wIconify would be waiting for
  503. the screen to open before it could process any icon requests).  For this
  504. reason, wIconSetter ignores any requests to add icons when the calling
  505. process is wIconify, so it is safe to use '[ANY]' in situations that could
  506. possibly include wIconify screens or windows.
  507.  
  508. Since the only windows openned by wIconify are the wIconify backdrop
  509. windows, this should not be a problem.  If you want to have the wIconify
  510. screens to have different icons from other screens, however, you can do it
  511. by using the SCREEN_IMAGE, SCREEN_SELECT, and SCREEN_MASK commands of the
  512. wIconify initialization file to specify the icon for wIconify screens:  this
  513. will be used by wIconify for its own screens (as well as all the others).
  514. Then use the commands
  515.  
  516.     Program:    [ANY]
  517.        Screen:  [ANY]
  518.           /* real default icon here */
  519.  
  520. to specify the icon you really want as the default icon.  wIconSetter will
  521. add this icon to all new screens that are openned by processes other than
  522. wIconify itself.
  523.  
  524.  
  525. Window Title Changes:
  526.  
  527. Some programs open their windows without titles, and then add the title once
  528. the window is open (e.g., Clock and Calculator supplied with WB 1.3).  For
  529. this reason wIconSetter traps the SetWindowTitles() Intuition routine, and
  530. when a window's title changes, wIconSetter checks its list of icons again to
  531. see if the window with it's new title should receive a special icon.
  532.  
  533. For example, you can specify:
  534.  
  535.     PROGRAM: Clock
  536.        Window:  Clock
  537.           Flags:  AUTOICONIFY
  538.           Name:   Clock
  539.  
  540. And even though the clock window opens with no title, when the Clock program
  541. renames its window, wIconSetter will recognize it at that point, and modify
  542. the icon accordingly.
  543.  
  544. A more interesting use of this feature is the following:  the More program
  545. provided with WB 1.3 changes the title of the CLI window in which it was
  546. run, and wIconSetter will notice this change.  The commands
  547.  
  548.     PROGRAM:  More
  549.       Window:  'AmigaShell'
  550.       Window:  'AmigaDOS'
  551.         Icon:  FROM Icons:CLI.Icon
  552.       Window:  [ANY]
  553.         Icon:  FROM Icons:More.Icon
  554.         Name:  'More'                   ; to avoid long names
  555.  
  556. can be take advantage of this in a clever way.  When MORE adds the window
  557. title, the WINDOW: [ANY] command will add the icon found in the file
  558. ICONS:MORE.ICON to the CLI window where MORE is running.  When MORE removes
  559. the window title and replaces the original title, the two other WINDOW
  560. commands will change the icon back to the stnadard CLI icon found in the 
  561. file ICONS:CLI.ICON (provided the original title was 'AmigaDOS' or
  562. 'AmigaShell').
  563.  
  564. Although the Shell window is owned by the NEWCON process, the PROGRAM command
  565. names MORE not NEWCON as the program since the window's title is being
  566. changed by the MORE program, not the NEWCON device.
  567.  
  568.  
  569. Ending wIconSetter:
  570.  
  571. To stop wIconSetter once it is running, issue the wIconSetter command again.
  572. If wIconSetter is called while the wIconSetter-Handler is already installed, 
  573. then wIconSetter will attempt to remove the handler from memory.
  574.  
  575. Unfortunately, it's not quite that easy.  It is unsafe to terminate wIconSetter
  576. while wIconify is running, since the icons set up by wIconSetter may still be
  577. in use by wIconify.  Thus wIconSetter will not terminate while wIconify is
  578. still running, so if you want to remove wIconSetter, you must first end
  579. wIconify itself.  Unfortunately, both wIconify and wIconSetter use the
  580. SetFunction() command to trap calls to the OpenWindow(), OpenScreen(), and
  581. SetWindowTitles() routines of the Intuition library, and since wIconify must
  582. be run first, it sets its trap before wIconSetter.  The current implementation
  583. of SetFunction() requires that the traps be removed in the reverse of the
  584. order in which they were set, so wIconify may not be able to remove its traps
  585. before wIconSetter exits.  This creates a "catch-22" situation, since
  586. wIconSetter can not exit before wIconify does.
  587.  
  588. The upshot of all this is that, under normal circumstances, it is imposible
  589. to end wIconify or wIconSetter once they are both running together.  This
  590. isn't such a bad problem since there is not usually any reason to end them
  591. once they are running.
  592.  
  593. The solution to this problem is to perform a modification of the
  594. SetFunction() routine (this has advantages not just for wIconify and
  595. wIconSetter, but for any program that traps system routines) so that
  596. traps can be be removed in any order.  The program PatchSetFunction, also
  597. written by the author of wIconify and available free of charge, is a program
  598. that does just that.  It is highly recommended, if you use programs that
  599. trap system calls, that you install PatchSetFunction before starting those
  600. programs.
  601.  
  602.  
  603. AUTHOR:
  604.  
  605. Davide P. Cervone
  606. Mathematics Department
  607. Brown University
  608. Providence, Rhode Island 02912
  609. ST402523@BROWNVM
  610.